package com.example.online.music.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppProperties {
    @Autowired
    private ServerProperties serverProperties;

    public String getIp() {
        return serverProperties.getAddress().getHostAddress();
    }

    public int getPort() {
        return serverProperties.getPort();
    }

    public String getContextPath() {
        return serverProperties.getServlet().getContextPath();
    }
}
